﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace MiddlewareTest.MiddlewareDelegate
{
    public class RequestContext
    {
        public RequestContext()
        {
            Items = new Dictionary<string, object>();
            Response = new ResponseModel();
            Request = new RequestModel();
            RequestIdentity = Guid.NewGuid().ToString();
        }

        public string RequestIdentity { get; }

        public IDictionary<string, object> Items { get; set; }

        public ResponseModel Response { get; set; }

        public RequestModel Request { get; set; }
    }

    public class ResponseModel
    {
        public Stream ResponseBody { get; set; }

        public JToken ResponseParameter { get; set; }

        public int StatusCode { get; set; }
    }

    public class RequestModel
    {
        public RequestModel()
        {
            RequestId = Guid.NewGuid().ToString();
        }

        public string TenantId { get; set; }

        public string RequestId { get; set; }

        public JToken RequestParameter { get; set; }
    }
}
